<template>
  <section v-if="track.length">
    <span v-for="(item, index) in track"
          :key="index">
      <icon-svg class-name="iconClass mr6"
                icon-name="dianzihuidan" />{{item}}<br />
    </span>
  </section>
  <section v-else>--</section>
</template>

<script>
export default {
  name: 'SupplementTrack',
  props: {
    device: {
      type: Object,
      default: () => { }
    }
  },
  computed: {
    track () {
      let trackValue = [];
      if (this.device?.trackList && this.device.trackList.length) {
        trackValue = this.device.trackList.map(x => {
          if (x.trackNo || x.deviceNo || x.flyNo) {
            return x.trackNo || x.deviceNo || x.flyNo
          }
        })
      }
      return trackValue;
    }
  },
}
</script>
<style scoped>
.mr6 {
  margin-right: 6px;
}
</style>